package com.ruantu.clothing.controller;

import com.ruantu.clothing.entity.JsonResponseMessage;
import com.ruantu.clothing.entity.User;
import com.ruantu.clothing.service.PrintDanService;
import com.ruantu.clothing.util.MyException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/25 0025.
 */

@Controller
public class PrintDanController {

    @Autowired
    private PrintDanService pdService;

    /***
     * 打印订单
     * @param chukuId
     * @param mode
     * @return
     */
    @RequestMapping("/print")
    public  String printChuKuDan(String chukuId, Model mode,HttpSession session){

        User u= (User)session.getAttribute("info");
        try {
            Map<String ,Object> map=pdService.printChuKuDan(chukuId,u.getJgid());
             mode.addAttribute("printList",map);
        }catch (MyException e){

        }catch (Exception e){

            e.printStackTrace();
        }
        return "/bbqq/print.jsp";
    }
}